package com.yanqu.road.entity.activity.turtle.data;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.activity.foxcard.UserFoxCardShop;

/**
 * @Author : Cxp
 * @Time : 2024-09-09
 * @Description : 乌龟对对碰-用户实体类
 */

@FieldTypeAnnotation(tableName = "t_u_turtle_data")
public class TurtleUserData extends DataObject {
    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "用户ID", select = true, update = true)
    private long userId;

    @FieldTypeAnnotation(desc = "个人总积分")
    private long score;

    @FieldTypeAnnotation(desc = "是否进行中")
    private boolean isPlaying;

    @FieldTypeAnnotation(desc = "坏模板累计数量")
    private int badTemplateCnt;

    @FieldTypeAnnotation(desc = "局数统计")
    private int roundCnt;

    @FieldTypeAnnotation(desc = "当前局游戏信息")
    private TurtleGame curGame;

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setUpdateOption();
        }
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setUpdateOption();
        }
    }

    public long getScore() {
        return score;
    }

    public void setScore(long score) {
        if (this.score != score) {
            this.score = score;
            setUpdateOption();
        }
    }

    public boolean getIsPlaying() {
        return isPlaying;
    }

    public void setIsPlaying(boolean isPlaying) {
        if (this.isPlaying != isPlaying) {
            this.isPlaying = isPlaying;
            setUpdateOption();
        }
    }

    public int getBadTemplateCnt() {
        return badTemplateCnt;
    }

    public void setBadTemplateCnt(int badTemplateCnt) {
        if (this.badTemplateCnt != badTemplateCnt) {
            this.badTemplateCnt = badTemplateCnt;
            setUpdateOption();
        }
    }

    public int getRoundCnt() {
        return roundCnt;
    }

    public void setRoundCnt(int roundCnt) {
        if (this.roundCnt != roundCnt) {
            this.roundCnt = roundCnt;
            setUpdateOption();
        }
    }

    public TurtleGame getCurGame() {
        return curGame;
    }

    public void setCurGame(TurtleGame curGame) {
        if (this.curGame != curGame) {
            this.curGame = curGame;
            setUpdateOption();
        }
    }

    public TurtleUserData clone() {
        TurtleUserData res = new TurtleUserData();

        res.setActivityId(this.getActivityId());
        res.setUserId(this.getUserId());
        res.setScore(this.getScore());
        res.setIsPlaying(this.getIsPlaying());
        res.setBadTemplateCnt(this.getBadTemplateCnt());
        res.setRoundCnt(this.getRoundCnt());
        res.setCurGame(this.getCurGame().clone());

        return res;
    }

    public void copy(TurtleUserData data) {
        this.setActivityId(data.getActivityId());
        this.setUserId(data.getUserId());
        this.setScore(data.getScore());
        this.setIsPlaying(data.getIsPlaying());
        this.setBadTemplateCnt(data.getBadTemplateCnt());
        this.setRoundCnt(data.getRoundCnt());
        if (data.getCurGame() != null) {
            if (this.curGame == null) {
                this.curGame = new TurtleGame();
            }
            this.curGame.copy(data.getCurGame());
        }
        setUpdateOption();
    }
}
